#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <unistd.h>
#include <string>
#include <sys/types.h>
#include <iostream>
using namespace std;

class GTTcpConnection;
class GTTcpServer
{
	public:
		GTTcpServer(const string& strIp, int nPort);
		~GTTcpServer();


	private:
		static void* ListenThreadFunc(void* arg);
		void  NewConnectionHandler(const sockaddr_in& stClientSocket, int nNewSock);

	private:
		string m_strServerIp;
		int m_nPort;
		int m_nSocket;

		GTTcpConnection* m_pConn;
};
